import { request } from '@/api/request'
import { useRequest } from '@/api/hooks/use-request'
import { ApiResponseData, BaseRequestMethod } from '../request/types'

const url = '/icafe/cnk'

export interface IcafeCategoryRequestMethod {
  getData: <T>(params?: any) => Promise<T>
  saveData: <T>(data?: any) => Promise<T>
}

// 获取数据列表
const getData = <T = ApiResponseData>(params?: any) => {
  return request.get<T>({
    url,
    params: params ?? {}
  })
}

// 创建数据
const saveData = <T = ApiResponseData>(data: any) => {
  return request.put<T>({
    url,
    data
  })
}

export { getData, saveData }
